Skip to content

chore(deps): Remove tslib dependency #5753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Sep 15, 2022

NOTE: Though most of the the problems the change causes have been solved, I'm leaving this in draft form until I can figure out why the tracePropogationTargets tests (and only the tracePropogationTargets tests) consistently fail. Very mysterious...


Now that we use Sucrase and Rollup for transpiling in our main build process, we no longer need tslib as a runtime dependency. (Sucrase and Rollup have their own ES6 polyfills, which we vendor.)

We do still use tsc when creating ES5 bundles, but we do so through rollup-plugin-typescript-2, which includes tslib among its own dependencies.

We've also been using it (indirectly) in our tests. ts-jest works by transpiling relevant TS files on the fly before running jest, and it's set to use the local tsconfig.test.json when it does so. Because all of our tsconfig files inherit from the tsconfig in @sentry/typescript, they've all been running with importHelpers set to true, which makes our testing dependent on tslib. But since we have no other reason to depend on tslib (and since we obviously don't care about bundle size when it comes to the temporary files ts-jest creates), it's fine to let TS just include the helper implementations alongside their use. Thus we can turn importHelpers off , which means we no longer need tslib as a direct dev dependency, either.

This therefore removes it from our dependencies, both at the repo and package levels.

Notes:

  • The change to importHelpers is done at the repo level, rather than being done directly in @sentry/typescript, because other packages (like sentry-capacitor and craft, among others) also depend on @sentry/typescript (and use our old build infrastructure, which needed the setting).

  • An old test testing for the inclusion of tslib code in our build files, and the skipFiles setting in one of our launch.json profiles have also been removed, as they are now moot.

@lobsterkatie lobsterkatie changed the title chore(deps): Move tslib to dev dependencies chore(deps): Remove tslib dependency Sep 15, 2022
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's gooooooooo

ref: #5331

cc @SimenB

@github-actions
Copy link
Contributor

github-actions bot commented Sep 16, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.51 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified) 60.26 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.1 KB (-0.02% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 53.18 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 19.89 KB (0%)
@sentry/browser - Webpack (minified) 64.59 KB (0%)
@sentry/react - Webpack (gzipped + minified) 19.92 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 44.83 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.03 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.41 KB (-0.01% 🔽)

@lobsterkatie lobsterkatie marked this pull request as draft September 16, 2022 01:05
@lobsterkatie lobsterkatie force-pushed the kmclb-move-tslib-to-dev-deps branch 2 times, most recently from 4731ed6 to a298135 Compare September 19, 2022 03:13
@lobsterkatie lobsterkatie force-pushed the kmclb-move-tslib-to-dev-deps branch from a298135 to d31eee9 Compare September 19, 2022 03:14
@github-actions
Copy link
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@SimenB
Copy link

SimenB commented Oct 18, 2022

🥺

@AbhiPrasad
Copy link
Member

Maybe one day we'll get back to this, but it might be easier to try upgrading TS before we do.

@AbhiPrasad AbhiPrasad deleted the kmclb-move-tslib-to-dev-deps branch January 30, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants